package wechat

import (
	"encoding/xml"
)

type (
	// WxMsg 混合用户消息，业务判断的主体

	// ArticleUrlResult 文章URL结果
	ArticleUrlResult struct {
		Count      int          `xml:"Count"`
		ResultList []ArticleItem `xml:"ResultList>item"`
	}

	// ArticleItem 文章项
	ArticleItem struct {
		ArticleIdx  int    `xml:"ArticleIdx"`
		ArticleUrl string `xml:"ArticleUrl"`
	}
	WxMsg struct {
		XMLName      xml.Name `xml:"xml"`
		ToUserName   string
		FromUserName string
		CreateTime   int64
		MsgId        string
		MsgID_Event int64  `xml:"MsgID"`   // 群发任务ID（与普通MsgId区分）
		MsgType      string
		Content      string  // text
		AgentID      int     // corp
		PicUrl       string  // image
		MediaId      string  // image/voice/video/shortvideo
		Format       string  // voice
		Recognition  string  // voice
		ThumbMediaId string  // video
		LocationX    float32 `xml:"Latitude"`  // location
		LocationY    float32 `xml:"Longitude"` // location
		Precision    float32 // LOCATION
		Scale        int     // location
		Label        string  // location
		Title        string  // link
		Description  string  // link
		Url          string  // link
		Event        string  // event
		EventKey     string  // event
		ChangeType   string  // crop change_external_contact
		ExternalUserID string //crop ExternalUserID
		UserID         string  //crop userId
		SessionFrom  string  // event|user_enter_tempsession
		Ticket       string
		FileKey      string
		FileMd5      string
		FileTotalLen string
		TaskId       string
		TagType      string
		Id           string
		NewUserID    string
		ScanCodeInfo struct {
			ScanType   string
			ScanResult string
		}
		ArticleUrlResult ArticleUrlResult `xml:"ArticleUrlResult"`

	}

	// WxMsgEnc 加密的用户消息
	WxMsgEnc struct {
		XMLName    xml.Name `xml:"xml"`
		ToUserName string
		AgentID    int
		Encrypt    string
		AgentType  string
	}
)
